# if练习-第三题-出租车计费

# 用户输入
km = input('输入公里数：')
print(km, type(km))
km = int(km)

pay = 0    # 花费

if 0 <= km <= 2:
    # print('我进入到这个分支中了')
    pay = 8
elif 2 < km <=12:
    pay = 8 + (km-2)*1.2
elif km > 12:
    pay = 8 + 10*1.2 + (km-12)*1.5
else:
    print('输入不合法')

# 打印结果
print('花费一共' + str(pay) + '元')